﻿using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace WordMaster
{
    public partial class PageNumberForm : Form
    {
        public PageNumberForm()
        {
            InitializeComponent();
        }

        public List<TaskInfo> Tasks = new List<TaskInfo>();

        private void btnChangeFont_Click(object sender, EventArgs e)
        {
            fontDialog1.Font = txtFontExample.Font;

            if(fontDialog1.ShowDialog() != DialogResult.Cancel)
            {
                txtFontExample.Font = fontDialog1.Font;
            }
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            Tasks.Add(new TaskInfo(
                    TaskTypes.PageNumberAdd,
                    "添加页码",
                    "格式=底部居中x/y，字体=" + txtFontExample.Font.FontFamily.Name + "，字体大小=" + txtFontExample.Font.Size.ToString() + "点",
                    new object[] {
                        txtFontExample.Font.FontFamily.Name,
                        Convert.ToInt32(txtFontExample.Font.Size)
                    }));
            //
            DialogResult = DialogResult.OK;
            Close();
        }
    }
}
